import random

#  全局变量
secret = 0
nummax =3


#  功能函数
def my_Test(guess):

    if guess == secret:
        print("你是我心里的小蛔虫吗")
        print("哼，猜对了也没有奖励")

    else:
        num = 0
        surplus = 0

        while guess != secret and num < nummax:
            surplus = nummax - num
            print("猜错了，笨蛋，你还有%d次机会" %surplus)

            temps = input("哎呀，猜错了请重新输入吧：")
            guess = int(temps)
            if guess == secret:
                print("你是我心里的小蛔虫吗")
                print("哼，猜对了也没有奖励")
            else:
                if num == 2:
                    print("我们一点默契也没有，拜拜~~~")
                else:
                    if guess > secret:
                        print("哥，大了大了~~")
                    else:
                        print("嘿，小了小了~~")

            num = num + 1



#  执行函数
def RunMRG():
    print('--------------欢迎来到快乐大本营----------')
    temp = 0
    guess = 0
    secret = random.randint(1, 10)
    temp = input("猜猜我心里想的是什么数字:")

    guess = int(temp)
    my_Test(guess)
    print("游戏结束，不玩啦^_^")